package com.lebang.medicalInquiry.constant;

/**
 * @version V1.0
 * @author: zpc
 * @date:
 */
public enum MessageTypeEnum {

    // 消息类型相关
    BIND("bind", "用户第一次连接进行user<=>channel双向绑定"),
    HEART("heart", "心跳消息"),
    KICKOFF("kickOff", "踢下线通知"),
    ONLINE("online", "用户上线通知"),
    OFFLINE("offline", "用户离线通知"),
    OFFLINETIP("offlinetip", "用户离线消息"),
    PRIVATECHAT("privateChat", "私聊"),
    MESSAGEACK("messageAck", "客户端消息的验证,保证消息可达"),
    READ("noticeReceive", "消息已读"),
    EXCEPTION("exception", "异常类型"),

    INTOLIVE("intolive", "进入直播间"),
    LEAVELIVE("leavelive", "离开直播间"),
    INTOLIVECHAT("intolivechat", "直播间弹幕"),
    LIVENUM("livenum", "直播间人数"),

    CALL("call", "语音通话"),

    QA_NOTICE("qa_notice", "回答问题通知"),
    CLOSE_LIVE("close_live", "关播通知");
    private String type;
    private String name;


    MessageTypeEnum(String type, String name) {
        this.type = type;
        this.name = name;
    }

    public static MessageTypeEnum getByType(String type) {
        MessageTypeEnum[] values = MessageTypeEnum.values();
        for (MessageTypeEnum messageTypeEnum : values) {
            if (messageTypeEnum.getType().equals(type)) {
                return messageTypeEnum;
            }
        }
        return null;
    }


    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
